package com.example.demo.service.impl;

import cn.hutool.dfa.SensitiveUtil;
import com.example.demo.service.SensitiveWordService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class SensitiveWordServiceImpl implements SensitiveWordService {


    /**
     * 初始化敏感词
     * 
     * @param 
     * @return  
     */
    @Override
    public void syncSensitiveWord() {
        List<String> wordList = sensitiveWordList();
        SensitiveUtil.init(wordList);
    }


    /**
     * 查询敏感词数据
     * 
     * @param 
     * @return {@link java.util.List<java.lang.String>} 
     */
    public List<String> sensitiveWordList() {
        List<String> list = new ArrayList<>();
        list.add("苹果");
        list.add("香蕉");
        list.add("橘子");
        return list;
    }
}
